import Mock from "mockjs"

//自己生成模拟数据
let newsList = [];
for (let i = 1; i <= 60; i++) {
	newsList.push({
		id: i, //编号
		title: "标题" + i + Mock.Random.ctitle(10, 30), //标题10-30字符
		img: Mock.Random.dataImage('100x100', '图片' + i), //图片
		content: "新闻详情" + i + Mock.Random.ctitle(500, 1000), //内容
		count: Mock.Random.integer(200, 999), //数量
		dt: Mock.Random.date(), //日期
	});
}

Mock.mock(new RegExp('/news/list'), 'get', options => {
	console.log(options) //仅仅是为了测试，看看这个值。
	return {
		code: 1,
		data: newsList,
	}
})

//详细用法参见官网   http://mockjs.com/